<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const count = ref(1)

    function ref(value) {
      return new RefImpl(value)
    }

    class RefImpl {
      constructor(value) {
        if (isRef(value)) return value
        this.dep = new Set([])
        if (typeof value === "object") {
          this.value = reactive(value)
        } else {
          this.value = value
        }
      }
      get() {
        //当ref的value数据被获取的时候,就会调用get方法,收集依赖
      }
      set() {
        //当ref的value数据被重新设置的时候,就会调用set方法,通知依赖更新
      }
    }
  </script>
</body>

</html>